|
![](/i/fill.gif) |
So I'm trying to load a datafile that consists of about 10,000 lines of
three values each. BUT the program only seems to load between 4,880 and
4,998 or so. Do you see anything wrong with this loading routine, or is it
my data/computer?
//////////////////////////////////////////////////////////
// Load the data file
//
#fopen dataFile "d:/docs/raytracing/redshiftData.txt" read
#declare LinesInFile = 10000;
#declare celestialData = array[3][ LinesInFile ];
#declare i = 0;
#while ( defined(dataFile) )
#declare rightAscentionAsDegrees = 0.0;
#declare declinationAsDegrees = 0.0;
#declare zVal = 0.0;
#read( dataFile, rightAscentionAsDegrees, declinationAsDegrees, zVal )
#declare celestialData[0][i] = rightAscentionAsDegrees;
#declare celestialData[1][i] = declinationAsDegrees;
#declare celestialData[2][i] = zVal;
#declare i = i+1;
#end
#debug concat( "\n\nTotal values read from file: ", str(i,5,0), "\n\n" )
#fclose dataFile
Post a reply to this message
|
![](/i/fill.gif) |